---
import Layout from '../layouts/base.astro'
import Header from '../components/header.astro'
import { getChannelInfo } from '../lib/telegram'
import { getEnv } from '../lib/env'

const channel = await getChannelInfo(Astro)

channel.seo = {
  title: 'Tags',
}

const tags = (getEnv(import.meta.env, Astro, 'TAGS') || '').split(',')
---

<Layout channel={channel} id="main-container">
  <slot name="header">
    <Header channel={channel} />
  </slot>

  <div class="section-title">Tags</div>

  <div class="tag-cloud">
    {
      tags.map((tag: string) => (
        <div class="tag-cloud-item">
          <a href={`/search/%23${tag}`} class="tag">
            {tag}
          </a>
          {/* <span class="tag-cloud-item-count">0</span> */}
        </div>
      ))
    }
  </div>
</Layout>
